﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>

    <title>小分类添加</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">

    <style type="text/css">
        table label {color:red; font-size:12px;margin-left:5px }
    </style>
    <link rel="stylesheet" href=" ${pageContext.request.contextPath}/css/style2.css" type="text/css"></link>
    <script type="text/javascript">
        function validateInput()
        {
            var result=true;
            document.getElementById("lblCateName").innerHTML="*";
            if(form1.cateName.value=="")
            {
                document.getElementById("lblCateName").innerHTML="分类名称不能为空";
                result=false;
            }

            if(result==true)
            {
                result=confirm("确定提交吗?");
            }

            return result;

        }

        //重置(清除页面信息)
        function clearInfo()
        {
            document.getElementById("lblCateName").innerHTML="*";
            document.form1.cateName.value="";
            document.form1.des.value="";
        }
    </script>
</head>

<body class="p10">


<form  name="form1" action="${pageContext.request.contextPath}/goodcate?catemethod=addSmall"  method="post" >
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td class="title2" > <img src="${pageContext.request.contextPath}/images/tb.gif" height="14" width="14" class="ico">添加二级分类</td>
        </tr>
    </table>
    <div style="margin-top: 8px"></div>
    <table  border="0" cellpadding="0" cellspacing="1" width="100%" class="table2">
        <tbody>
        <tr><td align="right" width="100">所属一级分类：</td><td>
            <select name="parentId" style="margin-left: 15px">
                <option value=''>请选择一级分类</option>
                <c:forEach items="${catef}" var="cateLevelOne">
                    <option value="${cateLevelOne.id}">${cateLevelOne.cateName}</option>
                </c:forEach>
                <input type="hidden" name="id" value=${cateLevelOne.id}>
            </select>
        </td>
        </tr>
        <tr><td align="right">二级分类名称：</td><td><input type="text" style="margin-left: 15px" name="cateName"  value='' /><label id="lblCateName">*</label></td></tr>
        <tr><td align="right">二级分类描述：</td><td><input type="text" style="margin-left: 15px" name="des"  value='' /></td></tr>

        <tr><td colspan="2"><input type="submit" style="margin-left: 50px"  class="bt" value="提交" onclick="return validateInput()"/>  <input type="button" value="重置" class="bt" onclick="clearInfo();"/><label  id="lblMsg"></label></td></tr>
        </tbody>
    </table>
</form>
</body>
</html>
